package cn.mymall.entity.mall;

import cn.mymall.util.DateUtil;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.sql.Timestamp;

@Data
@EqualsAndHashCode(callSuper = true)
@TableName("mall_picture")
public class Picture extends Model {
	private static final long serialVersionUID = -2639232602286276862L;
	/**
	 * 商品图片
	 */
	@TableId(value = "id",type = IdType.AUTO)
	private Integer id;
	private String logo;				//图片地址
	private Integer productId;
	private Integer sortNum;			//排
	private Timestamp addTime;
	public Picture(){
		this.addTime = DateUtil.getCurFullTimestamp();
		this.sortNum = 1;
	}
	public Picture(String logo, Integer productId){
		this();
		this.logo = logo;
		this.productId = productId;
	}
}
